//
//  WSGFoundController.m
//  oneDollar
//
//  Created by Laki on 16/6/23.
//  Copyright © 2016年 com.Laki.corder. All rights reserved.
//

#import "WSGFoundController.h"
#import "WSGFoundAPI.h"
#import "WSGWebViewController.h"

@interface WSGFoundController ()
@property (nonatomic,strong) NSDictionary *foundDict;
@end

@implementation WSGFoundController
/** 头部高度*/
NSInteger const footerHeight = 10;
/** 尾部高度*/
NSInteger const headerHeight = 0;
/** 头部内边距*/
NSInteger const topHeight = -35;

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 设置头部和尾部高度
    self.tableView.sectionFooterHeight = footerHeight;
    self.tableView.sectionHeaderHeight = headerHeight;
    
    // 设置tableView内边距
    self.tableView.contentInset = UIEdgeInsetsMake(topHeight, 0, 0, 0);
    
    self.foundDict = @{ @"0:0" : WSGNewUser,
                        @"1:2" : WSGMakeMoney,
                        @"1:3" : WSGHelp,
                        @"2:0" : WSGMall,
                        @"2:1" : WSGExplode};
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString *key = [NSString stringWithFormat:@"%zd:%zd",indexPath.section,indexPath.row];
    WSGWebViewController *webView = [[WSGWebViewController alloc] init];
    webView.url = self.foundDict[key];
    webView.hidesBottomBarWhenPushed = YES;

    [self.navigationController pushViewController:webView animated:YES];
}
@end
